<?php

class issue {

    private $mId;
    private $mName;
    private $mDescription;
    private $mStart_date;
    private $mDue_date;
    private $mPriority;
    private $mTask_id;
    private $mStatus_id;
    private $mCreated_by;
    private $mCreated_date;
    private $mLast_update_by;
    private $mLast_update_date;
    private $mComment;
    
    public function getId(){
        return $this->mId;
    }
    
    public function setId($value){
        $this->mId = $value;
    }
    
    public function getName(){
        return $this->mName;
    }

    public function setName($value){
        $this->mName = $value;
    }
    
    public function getDescription(){
        return $this->mDescription;
    }
    
    public function setDescription($value){
        $this->mDescription = $value;
    }

    public function setStartDate($value){
        $this->mStart_date = $value;
    }    

    public function getStartDate(){
        return $this->mStart_date;
    }

    public function setDueDate($value){
        $this->mDue_date = $value;
    }
    
    public function getDueDate(){
        return $this->mDue_date;
    }

    public function setPriority($value){
        $this->mPriority = $value;
    }
    
    public function getPriority(){
        if (($this->mPriority != null) && (!$this->mPriority->IsLoaded(false))) {
            $priorityDao = new PriorityDao();
            $this->mPriority = $priorityDao->getObject($this->mPriority->getId());
            if ($this->mPriority != null) $this->mPriority->setIsLoaded(true);
            }
        
        return $this->mPriority;
    }

    public function setTask($value){
        $this->mTask_id = $value;
    }
    
    public function getTask(){
        if (($this->mTask_id != null) && (!$this->mTask_id->IsLoaded(false))) {
            $taskDao = new TaskDao();
            $this->mTask_id = $taskDao->getObject($this->mTask_id->getId());
            if ($this->mTask_id != null) $this->mTask_id->setIsLoaded(true);
            }
        return $this->mTask_id;
    }
    
    public function setStatus($value){
        $this->mStatus_id = $value;
    }

    public function getStatus(){
        if (($this->mStatus_id != null) && (!$this->mStatus_id->IsLoaded(false))) {
            $statusDao = new StatusDao();   
            $this->mStatus_id = $statusDao->getObject($this->mStatus_id->getId());
            if ($this->mStatus_id != null) $this->mStatus_id->setIsLoaded(true);
        }
        return $this->mStatus_id;
    }
    
    public function getComment(){
        if (($this->mComment == null)) {
            $CommentDao = new CommentDao();
            $this->mComment = $CommentDao->getListByIssueId($this->mId);
            }
        return $this->mComment;
    }
    
    public function setComment($value){
        $this->mComment = $value;
    }
    
    public function setCreatedBy($value){
        $this->mCreated_by = $value;
    }

    public function getCreatedBy(){
        if (($this->mCreated_by != null) && (!$this->mCreated_by->IsLoaded(false))) {
            $userDao = new UserDao();   
            $this->mCreated_by = $userDao->getObject($this->mCreated_by->getId());
            if ($this->mCreated_by != null) $this->mCreated_by->setIsLoaded(true);
            }
        return $this->mCreated_by;
    }

    public function setLastUpdateBy($value){    
        $this->mLast_update_by = $value;
    }
    
    public function getLastUpdateBy(){
        if (($this->mLast_update_by != null) && (!$this->mLast_update_by->IsLoaded(false))) {
            $UserDao = new UserDao();
            $this->mLast_update_by = $UserDao->getObject($this->mLast_update_by->getId());
            if ($this->mLast_update_by != null) $this->mLast_update_by->setIsLoaded(true);
            }
        
        return $this->mLast_update_by;
    }
    
    public function setCreatedDate($value){
        $this->mCreated_date = $value;
    }

    public function getCreatedDate(){
        return $this->mCreated_date;
    }
    
    public function setLastUpdateDate($value){
        $this->mLast_update_date = $value;
    }

    public function getLastUpdateDate(){
        return $this->mLast_update_date;
    }
    
    public function IsLoaded() {
        return $this->mIsLoaded;
    }

    public function setIsLoaded($value){
        $this->mIsLoaded = $value;
    }

}
